package com.okRPC.serialization;

import com.okRPC.exception.SerializationException;

/**
 * Description: This is a sample class.
 * Author: Simon
 * Date: 2023/10/10
 */
public class SerializationFactory {
    public static RpcSerialization getSerialization(SerializationTypeEnum typeEnum){
        switch (typeEnum) {
            case JSON:
                return new JsonSerialization();
            case HESSIAN:
                return new HessianSerialization();
            default:
                throw new SerializationException("illegal type of Serialization");
        }
    }
}
